public class Solution357 {
    public int countNumbersWithUniqueDigits(int n) {
        int[] f=new int[11];
        f[0]=1;
        for (int i=1;i<=10;i++){
            f[i]=f[i-1]*i;
        }
        int ans=1;
        for (int i=1;i<=n;i++){
            ans=ans+(f[10]-f[9])/f[10-i];
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution357().countNumbersWithUniqueDigits(2));
    }
}
